package com.zangchat.controller;

import com.common.core.domain.AjaxResult;
import com.zangchat.service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/zangchat/sms")
public class SmsConreoller {

    @Autowired
    private ISmsService smsService;

    @RequestMapping("/sendCode")
    public AjaxResult sendCode(@ModelAttribute("phone") String phone,
                               HttpServletRequest request,
                               @ModelAttribute("type") String type){
        return smsService.sendCode(phone,request,type);
    }

}
